package com.thinktank.controller;

import static com.thinktank.util.DbUtil.*;
import java.io.*;
import java.sql.*;

import javax.servlet.*;
import javax.servlet.http.*;

import com.thinktank.vo.Board;
import com.thinktank.vo.Reply;
import com.thinktank.dao.BoardDao;

public class BoardReplyDeleteProcessController implements Controller {
	public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		String rNo = request.getParameter("rNo");
		String bNo = request.getParameter("bNo");
		
		Connection con = getConnection();				
		BoardDao dao = new BoardDao(con);
		Board board = new Board();
		int result = dao.replydelete(rNo);
	
		close(con);
		
		
		if(result == 0) {
			return "error.jsp";
		}
		
	//	return "redirect:boardDetail.do";
		return "redirect:boardDetail.do?bNo="+bNo;
	}
}
